package buttons;

import processing.core.PApplet;
import view.DisplayList;
import controllers.ControlManager;
import buttons.control.C_ToggleButton;
import buttons.view.V_CheckBox;

public class CheckBox extends TextButton
{
	  public CheckBox(DisplayList v, ControlManager c, String n, float xWidth, float yHeight, PApplet p)
	  {
	     super(v, c, n, xWidth, yHeight, p);
	  }
	  // constructor for buttons that don't move around:
	  public CheckBox(DisplayList v, ControlManager c, String n, float xWidth, float yHeight, float xPos, float yPos, PApplet p)
	  {
	     super(v, c, n, xWidth, yHeight, xPos, yPos, p);
	  }
	  @Override
	  public void generateButtons(DisplayList v, ControlManager c, String n, float xWidth, float yHeight)
	  {
		  System.out.println("check box created");
	      vButton = new V_CheckBox(n, xWidth, yHeight);
	      cButton = new C_ToggleButton((V_CheckBox)vButton);
	      addToManagerLists(v, c);
	  }
	  public boolean getToggle()
	  {
	    return ((C_ToggleButton)cButton).getToggle();
	  }
	  public void forceToggle(boolean val)
	  {
	    if(val)  ((C_ToggleButton)cButton).forceToggleOn();
	    else  ((C_ToggleButton)cButton).forceToggleOff();
	  }
	}
